<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      >
    <h:head>
        <title>Theo dõi trạng thái tài khoản</title>
        <script>
            function confirmComplete() {
                var answer = confirm("Bạn có chắc chắn muốn xóa bản ghi này?");
                if (answer == true)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
        </script>        
    </h:head>
    <h:body> 
        <link type="text/css" rel="stylesheet" href="../css/main.css" />        
        <style type="text/css">
            .ui-widget{font-size:95% !important;}
            .ui-layout-unit-content{background-color: #E5E5E5;border-width: 0px}      
            .ui-widget{border-width: 0px;color: red}
        </style>
        <div align="center" id="bodyForm" >            
            <div style="width: 100%;">
                <p:layoutUnit id="top" position="north" size="auto">
                    <ui:insert name="menu">
                        <ui:include src="../../templates/menu.xhtml"/>
                    </ui:insert>
                </p:layoutUnit>

                <p:layoutUnit id="center" position="center" size="400">
                    <h1 class="headerbar">Theo dõi trạng thái tài khoản</h1>
                    <h:form id="form">
                        <h:panelGrid columns="2">
                            <h:outputText value="Thời gian reload trang: "/>
                            <p:selectOneMenu value="#{iPCC_SESSIONController.timeRe}" style="width: 100px">
                                <f:selectItem itemValue="5" itemLabel="5"/>
                                <f:selectItem itemValue="10" itemLabel="10"/>
                                <f:selectItem itemValue="15" itemLabel="15"/>
                                <p:ajax event="change" update="poll"/>
                            </p:selectOneMenu>
                        </h:panelGrid>
                        <p:poll interval="#{iPCC_SESSIONController.timeRe}" listener="#{iPCC_SESSIONController.reload()}" update=":form" id="poll"/>
                        <br></br>
                        <p:growl id="messages"/> 
                        <p:dataTable value="#{iPCC_SESSIONController.items}" var="i" id="table">
                            <p:column headerText="Status" style="width: 40px">
                                <div align="center">
                                    <p:graphicImage value="../../images/online.gif" style="width: 20px;height: 20px" rendered="#{i.contact_status eq 1}"/>
                                </div>
                                <!--<h:outputText value="#{i.contact_status}" style="float: right"/>-->
                            </p:column>
                            <p:column headerText="User Id">
                                <h:outputText value="#{i.user_id}" style="float: right"/>
                            </p:column>
                            <p:column headerText="Call group">
                                <h:outputText value="#{i.callgroup}" style="float: right"/>
                            </p:column>
                            <p:column headerText="Caller name">
                                <h:outputText value="#{i.effective_caller_id_name}" style="float: right"/>
                            </p:column>
                            <p:column headerText="Caller number">
                                <h:outputText value="#{i.effective_caller_id_number}" style="float: right"/>
                            </p:column> 
                            <p:column headerText="Last updated">
                                <h:outputText value="#{i.last_updated}" style="float: right"/>
                            </p:column>
                        </p:dataTable>                
                    </h:form>
                </p:layoutUnit>
                <p:layoutUnit id="bottom" position="bottom" size="60">
                    <ui:insert name="footer">
                        <ui:include src="../../templates/footer.xhtml"/>
                    </ui:insert>
                </p:layoutUnit>
            </div>
        </div>
    </h:body>
</html>

